An implementation of the SHA-2 cryptographic hash algorithms.
There are 6 standard algorithms specified in the SHA-2 standard:
Sha224
, which is the 32-bitSha256
algorithm with the result truncated to 224 bits.Sha256
, which is the 32-bitSha256
algorithm.Sha384
, which is the 64-bitSha512
algorithm with the result truncated to 384 bits.Sha512
, which is the 64-bitSha512
algorithm.Sha512Trunc224
, which is the 64-bitSha512
algorithm with the result truncated to 224 bits.Sha512Trunc256
, which is the 64-bitSha512
algorithm with the result truncated to 256 bits.
Algorithmically, there are only 2 core algorithms: Sha256
and Sha512
.
All other algorithms are just applications of these with different initial
hash values, and truncated to different digest bit lengths.
Usage
# extern crate hex_literal;
# extern crate sha2;
#
Also see RustCrypto/hashes readme.